package com.sky.mapper;

import com.sky.dto.GoodsSalesDTO;
import com.sky.dto.OrderReportDto;
import com.sky.entity.Orders;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author zcf
 */
@Mapper
public interface OrderMapper {
    List<Orders> list3(String number, String beginTime, String endTime, Integer status, String phone);

    @Select("select count(*) from orders where status = #{status}")
    Integer count(Integer status);


    @Select("select * from orders where status = #{pendingPayment} and order_time < #{BeForeTime}")
    List<Orders> list(Integer pendingPayment, LocalDateTime BeForeTime);

    List<OrderReportDto> countOrders(LocalDateTime beginTime, LocalDateTime endTime, Integer status);

    List<GoodsSalesDTO> list4(LocalDateTime beginTime, LocalDateTime endTime,Integer status);

    @Select("select count(*) from orders ")
    Integer count1();
}
